package com.shuiqian.talentpool.resp;

import com.shuiqian.talentpool.enums.ResultsCodeEnum;
import lombok.Data;

/**
 * @author landongqi
 * @create 2019-11-26 13:34
 */
@Data
public class Results<T> {


    private Integer code = 200;//是否成功

    private String msg = "操作成功";//提示信息

    private T result;

    public Results(Integer code, String msg, T result) {
        this.code = code;
        this.msg = msg;
        this.result = result;
    }

    public Results() {
        super();
    }

    public Results(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Results(T result) {
        this.result = result;
    }

    public Results(ResultsCodeEnum resultsCodeEnum) {
        this.code = resultsCodeEnum.getCode();
        this.msg = resultsCodeEnum.getMsg();
    }
}
